home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1984 June
/
1984-06.d64
/
spell critter_64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
117 lines
10 poke52,48:poke56,48:clr
20 poke53281,1:print"[147]":poke53281,6:poke53280,6
30 s=54272:v=54296:ad=54277:sr=54278:hf=54273:lf=s:sd=54276
40 forl=stos+24:pokel,0:next:pokead,14:pokesr,204
50 fori=1436to1443:pokei,int(rnd(1)*25)+1:next:fori=1445to1451
60 pokei,int(rnd(1)*25)+1:next:fori=1 to 500:next
70 fori=1436to1443:readl:pokei,l+128:gosub110:forj=1to70:nextj:pokesd,32:nexti
80 fori=1445to1451:readl:pokei,l+128:gosub110:forj=1to70:nextj:pokesd,32:nexti
90 data19,16,5,12,12,9,14,7,3,18,9,20,20,5,18
100 poke1444,160:goto 120
110 pokev,15:pokehf,40:pokelf,50:pokesd,33:pokev,0:return
120 print"one moment................please!"
130 printchr$(142):poke56334,peek(56334)and254
140 poke1,peek(1)and251:fori=0to511:pokei+12288,peek(i+53248):next
150 poke1,peek(1)or4:poke56334,peek(56334)or1
160 fori=1to3:readw:forc=wtow+7:reada:pokec,a:nextc:nexti
170 data12288,96,128,77,63,31,13,0,0
180 data12784,3,52,184,240,240,184,52,3
190 data12776,0,54,58,242,242,58,54,0
200 dimw$(50):cl=54272
210 forj=1to7:readm$(j):nextj
220 poke53272,(peek(53272)and240)or12
230 poke53281,1:print"[147]":poke53281,6:poke53280,6
240 r=1464:j=1:gosub450:gosub850
250 n$=nm$:poke53272,21
260 gosub710:poke53281,1:print"[147]":poke53281,6:poke53280,6
270 wg=0:rt=0
280 forb=1ton
290 print"[147]":poke214,12:print:poke211,int((40-len(w$(b)))/2)-1:printw$(b)
300 fort=1to1000:next
310 print"[147] to review the word press ? key"
320 poke53272,28:r=1464:j=2:gosub450:gosub850
330 a$=nm$
340 ifa$="that word"thenj=6:r=1704:gosub1020:gosub450:r=1544:gosub790:goto290
350 ifasc(a$)=63orasc(a$)=47then290
360 ifa$=w$(b)thengosub1020:j=5:m$(j)=m$(j)+" "+n$:r=1704:gosub450
370 ifj=5thenrt=rt+1:gosub400:gosub570:goto560
380 wg=wg+1:gosub1020:j=3:m$(j)=m$(j)+" "+n$:r=1704:gosub450:gosub570
390 j=4:r=1824:m$(j)=m$(j)+" "+w$(b):gosub450:r=1544:gosub790:gosub570
395 m$(j)="the correct answer is:":goto590
400 rem correct answer sound
410 pokev,15:pokesd,17:fors=40to100
420 pokehf,int(rnd(1)*100+40):pokelf,s:ford=1to20:next
430 next:pokesd,16:return
440 rem message routine
450 c=((r-1024)/40)-1:cn=int((40-len(m$(j)))/2)-1
460 fori=1tolen(m$(j)):lr=r+cn+i:iflr>2023thenlr=2023
470 fork=1to20:nextk:pokelr+1,32
480 pokelr,0:pokelr+1,62:pokelr+cl,1:pokelr+cl+1,1:gosub110:pokesd,32
490 fork=1to20:nextk:pokelr,32
500 a=asc(mid$(m$(j),i,1)):ifa=32thenpokelr,a:goto530
510 ifa<65ora>90thenpoke214,c:print:poke211,cn+i:printchr$(a):goto530
520 ch=a-64:pokelr,ch:pokelr+cl,1
530 nexti
540 ford=lr+1tor+38:poked,0:poked+1,62:poked+cl,3:poked+cl+1,3:gosub110
550 pokesd,32:fork=1to10:nextk:poked,32:poked+1,32:nextd:return
560 poke198,0:print"hit any key":goto 580
570 m$(j)=mid$(m$(j),1,len(m$(j))-len(n$)-1):return
580 getz$:ifz$=""then580
590 nextb
600 rem game over routine
610 poke53272,21:print"[147]the game is over"
620 print"right";tab(33);"wrong"
630 print"";rt;tab(33);wg
640 print" would you like to play again (y/n)?"
650 getz$:ifz$=""or(z$<>"y"andz$<>"n")then650
660 ifz$="y"thenfori=1ton:w$(i)="":next:goto260
670 print"[147] it has been very nice spelling with you ";n$;"."
680 print" please come back to play again."
690 poke53272,28:r=1704:j=7:gosub450:poke53272,21:end
700 rem input
710 poke53280,3:poke53281,3
720 print"[147]how many words do we have today";:inputz$:n=val(z$)
725 ifn>50orn=0then720
730 print"[147] [160]check your spelling!![146]"
740 forx=1ton
750 poke214,12:print:poke211,5:print"enter word # ";x;:input"[157]";w$(x)
760 fori=1to17:poke214,12:print:poke211,21+i:printchr$(32):nexti
765 iflen(w$(x))=0orlen(w$(x))>10then750
766 ifasc(w$(x))<65orasc(w$(x))>90then750
770 nextx:return
780 rem erase routine
790 fori=rtor+38
800 ch=62:if(i+1)/2=int((i+1)/2)thench=61
810 pokei+cl,1:pokei+cl+1,1
820 pokei,0:pokei+1,ch:ford=1to50:nextd
830 pokei,32:gosub110:pokesd,32:nexti:pokei,32:return
840 rem answer routine
850 poke198,0:poke1561+cl,1:poke1562+cl,1:poke1561,0:poke1562,62:ct=1:nm$=""
860 getz$:ifz$=""then860
870 ifasc(z$)=63orasc(z$)=47thennm$=z$:return
880 ifasc(z$)=32thena=32:goto920
890 ifasc(z$)=13andlen(nm$)<>0then950
900 ifasc(z$)<65orasc(z$)>90then860
910 a=asc(z$)-64
920 nm$=nm$+z$:poke1560+ct,a:poke1561+ct,0:poke1561+ct+1,62
930 poke1560+ct+cl,1:poke1561+ct+cl,1:poke1561+ct+cl+1,1:ct=ct+1
940 gosub110:pokesd,32:goto860
950 ifj<>1thenreturn
960 fori=1561to1582:pokei,32:forj=1tolen(nm$)
970 a=i+j:ifa>1582thena=1582:pokea,32:goto 990
975 as=asc(mid$(nm$,j,1)):ifas<65oras>90thenpokea,32:goto990
980 pokea+cl,1:pokea,as-64
990 nextj:a=i+j+1:ifa>1582thena=1582:pokea,32:goto 1010
1000 pokea-1+cl,1:pokea+cl,1:pokea-1,0:pokea,62
1010 fork=1to30:nextk:gosub110:pokesd,32:nexti:return
1020 fori=1561+len(nm$)to1581
1030 pokei+cl,1:pokei+1+cl,1:pokei+2+cl,1:pokei,32:pokei+1,0:pokei+2,62
1040 gosub110:pokesd,32:nexti:pokei,32:pokei+1,32:return
1050 data"hi, what is your name"
1060 data"how do you spell that word"
1070 data"i'm sorry, that is wrong"
1080 data"the correct answer is:"
1090 data"that is right, very good"
1100 data"very funny, wiseguy"
1110 data"bye! bye! bye!"